package com.acwing.partition34;

import java.io.*;

/**
 * @author rkc
 * @date 2022/8/5 9:03
 */
public class AC3307破纪录者 {

    private static final int N = 200010;
    private static int[] w = new int[N], maxv = new int[N];
    private static int n;

    private static StreamTokenizer tokenizer = new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in)));
    private static PrintWriter writer = new PrintWriter(new OutputStreamWriter(System.out));

    public static void main(String[] args) throws IOException {
        int t = nextInt();
        for (int k = 1; k <= t; k++) {
            n = nextInt();
            for (int i = 0; i < N; i++) maxv[i] = 0;
            for (int i = 0; i < n; i++) {
                w[i] = nextInt();
                if (i > 0) {
                    maxv[i] = Math.max(maxv[i - 1], w[i - 1]);
                }
            }
            int ans = w[0] > w[1] ? 1 : 0;
            for (int i = 1; i < n; i++) {
                if (w[i] > maxv[i]) {
                    if (i == n - 1) ans++;
                    else if (w[i] > w[i + 1]) ans++;
                }
            }
            writer.format("Case #%d: %d\n", k, ans);
        }
        writer.flush();
    }

    private static int nextInt() throws IOException {
        tokenizer.nextToken();
        return (int) tokenizer.nval;
    }
}
